/**
 * Created by xiey on 2016/4/18.
 */
var path = require('path'),
    gulp = require('gulp'),
    $    = require('gulp-load-plugins')(),
    conf = require('./common/conf');

gulp.task('build', ['inject'], function () {
    return gulp.src(path.join(conf.paths.tmp, 'index.html'))
        .pipe($.usemin({
            vendorCss: [$.cleanCss(), $.rev()],
            vendorJs : [$.uglify(), $.rev()],
            appCss   : [$.cleanCss(), $.rev()],
            appJs    : [$.uglify(), $.rev()],
            html: [ $.minifyHtml({ empty: true }) ]
        }))
        .pipe(gulp.dest(conf.paths.build))
        .pipe(conf.genLog());
});